data = -1

positives = 0
negatives = 0

total = 0
average = 0.0
while data != 0:
    data = eval(input("请输入一个数，当输入0则终止："))
    if data < 0:
        negatives += 1
        total += data
    elif data > 0:
        positives += 1
        total += data
    else:
        print("正数有",positives,"个")
        print('负数有',negatives,"个")
        print("总和为：",total)
        print("平均数：",(total/(positives+negatives)))

        positives = 0
        negatives = 0
        total = 0
        average = 0.0
        data = eval(input("请输入一个数，当输入0则终止："))

print("结束")